﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LTHD_Web
{
    public partial class like : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int placeid = int.Parse(Request["id"]);
            int type = int.Parse(Request["type"]);
            int userid = int.Parse(Request.Cookies["userid"].Value);


            dbDataContext db = new dbDataContext();
            var query = from n in db.diadiems where n.id == placeid select n;

            diadiem info = new diadiem();
            info.ten = query.First().ten;
            info.taikhoan = userid;
            info.latitude = query.First().latitude;
            info.longitude = query.First().longitude;
            info.linhvuc = query.First().linhvuc;
            info.status = 2; 
            info.diachi = query.First().diachi;
            info.chitiet = query.First().chitiet;

            db.diadiems.InsertOnSubmit(info);
            db.SubmitChanges(); 
        }
    }
}